<%-- 
    Document   : html
    Created on : 27.03.2009, 22:44:16
    Author     : Aike J Sommer
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<f:view>
    <html>
        <head>
            <title>ViewNControl</title>
            <script type="text/javascript" src="/script/jquery.js"></script>
            <script type="text/javascript">
            </script>
        </head>
        <body>

            Connected: <h:outputText value="#{screenView.connectedLocal}" /><br />
            <h:panelGroup rendered="#{! screenView.connected}">
                <h:form>
                    Host: <h:inputText value="#{screen.host}" /><br />
                    Port: <h:inputText value="#{screen.port}" /><br />
                    Password: <h:inputSecret value="#{screen.password}" /><br />
                    <h:commandLink value="Connect" action="#{screenView.connect}" /><br />
                </h:form>
            </h:panelGroup>
            <h:panelGroup rendered="#{screenView.connected}">
                Host: <h:outputText value="#{screen.host}" /><br />
                Port: <h:outputText value="#{screen.port}" /><br />
                Session: <h:outputText value="#{screenView.name}" /><br />
                <h:form>
                    <h:commandLink value="Disconnect" action="#{screenView.disconnect}" /><br />
                </h:form>
                <a href="screen.jsf" target="_blank" onclick="openScreen(); return false;">Open screen</a><br />

                <script type="text/javascript">
                    function openScreen() {
                        var width = <h:outputText value="#{screenView.width}" />;
                        var height = <h:outputText value="#{screenView.height}" />;
                        var screen = window.open("screen.jsf", "_blank", "width=" + width + ",height=" + height + ",status=yes,scrollbars=no,resizable=yes");
                        screen.focus();
                        return false;
                    }
                </script>
            </h:panelGroup>

        </body>
    </html>
</f:view>
